Skip to content

fix: issue where when the status is set to away, the app does not ring and no join btn is visible [WPB-22834]#5018

Merged
MohamadJaara merged 10 commits into
developfrom
mo/refactor/get-calls-status-from-in-memory
Jul 13, 2026
Merged

fix: issue where when the status is set to away, the app does not ring and no join btn is visible [WPB-22834]#5018
MohamadJaara merged 10 commits into
developfrom
mo/refactor/get-calls-status-from-in-memory

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Jul 1, 2026

Copy link
Copy Markdown
Member

https://wearezeta.atlassian.net/browse/WPB-22834

  • Move ongoing/joinable call status out of conversation state and into an in-memory call store keyed by conversation ID.
  • Use the in-memory joinable call data for conversation list/search ordering and join-call row markers.
  • Remove public conversation call-state fields from Kalium conversation models.
  • Keep existing DB call updates for compatibility with current consumers.
  • Add a changelog fragment for the breaking API/source change.
  • Fix the issue where when the status is set to away, the app does not ring and no join btn is visible, making users thinks calls are not received.

Data Flow

flowchart LR
    AVS["AVS call events"]
    CallRepo["CallRepository"]
    Memory["In-memory calls map<br/>ConversationId -> Call"]
    DB["Call DB writes<br/>(kept for existing consumers)"]
    Ordering["Conversation list/search ordering"]
    AppUI["Android conversation UI<br/>join button / row marker"]

    AVS --> CallRepo
    CallRepo --> Memory
    CallRepo --> DB
    Memory --> Ordering
    Memory --> AppUI
Loading

Why

Conversation list state should not depend on persisted calling rows or session-init reset work. Keeping active AVS call state in memory avoids DB pressure during Kalium init and gives consumers faster ConversationId -> Call lookup.

Breaking Change

Removed call-state fields from public Kalium conversation models:

  • ConversationDetails.Group.hasOngoingCall
  • ConversationDetailsWithEvents.hasOngoingCall

Consumers should derive join-call UI from call APIs / the in-memory joinable-call map instead.

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.62687% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.40%. Comparing base (1654322) to head (cc48d27).

Files with missing lines Patch % Lines
...tlin/com/wire/android/mapper/ConversationMapper.kt 30.00% 5 Missing and 2 partials ⚠️
...tions/usecase/GetConversationsFromSearchUseCase.kt 91.48% 1 Missing and 3 partials ⚠️
...wire/android/ui/calling/CallingViewModelFactory.kt 0.00% 2 Missing ⚠️
...n/com/wire/android/ui/home/HomeViewModelFactory.kt 0.00% 2 Missing ⚠️
...ome/conversationslist/ConversationListViewModel.kt 33.33% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (74.62%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5018      +/-   ##
===========================================
+ Coverage    49.35%   49.40%   +0.05%     
===========================================
  Files          653      653              
  Lines        23543    23598      +55     
  Branches      3621     3625       +4     
===========================================
+ Hits         11619    11659      +40     
- Misses       10848    10861      +13     
- Partials      1076     1078       +2     
Files with missing lines Coverage Δ
...me/conversations/call/ConversationCallViewModel.kt 91.37% <100.00%> (ø)
...wire/android/ui/calling/CallingViewModelFactory.kt 0.00% <0.00%> (ø)
...n/com/wire/android/ui/home/HomeViewModelFactory.kt 0.00% <0.00%> (ø)
...ome/conversationslist/ConversationListViewModel.kt 30.72% <33.33%> (-0.80%) ⬇️
...tions/usecase/GetConversationsFromSearchUseCase.kt 85.71% <91.48%> (+6.86%) ⬆️
...tlin/com/wire/android/mapper/ConversationMapper.kt 52.27% <30.00%> (-0.91%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1654322...cc48d27. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MohamadJaara MohamadJaara changed the title fix: issue where when the status is set to away, the app does not ring and no join btn is visible. fix: issue where when the status is set to away, the app does not ring and no join btn is visible [WPB-22834] Jul 1, 2026
@MohamadJaara MohamadJaara requested a review from Copilot July 1, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Android app’s conversation list/search and call UI to derive “ongoing/joinable call” indicators from Kalium’s in-memory joinable-calls observation, rather than relying on persisted conversation call-state fields. This aligns with the breaking Kalium model change and targets the reported issue where calls aren’t surfaced correctly (e.g., missing join UI) when the user status is set to Away.

Changes:

  • Inject and consume ObserveJoinableCallsUseCase in conversation list/search flows to drive join-call markers and related ordering signals.
  • Update ConversationDetailsWithEvents.toConversationItem() mapping to compute hasOnGoingCall/“new activities” from the joinable-calls map.
  • Adjust DI wiring and unit tests to accommodate removal of model call-state fields and the new joinable-calls source.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/test/kotlin/com/wire/android/ui/home/conversationslist/ConversationListViewModelTest.kt Mocks ObserveJoinableCallsUseCase to support updated conversation list ViewModel dependencies.
app/src/test/kotlin/com/wire/android/ui/home/conversations/usecase/GetConversationsFromSearchUseCaseTest.kt Adds coverage ensuring joinable calls produce an ongoing-call marker in search results.
app/src/test/kotlin/com/wire/android/ui/home/conversations/details/updateappsaccess/UpdateAppsAccessViewModelTest.kt Removes usage of the deleted hasOngoingCall model field in test fixtures.
app/src/test/kotlin/com/wire/android/ui/home/conversations/details/GroupDetailsViewModelTest.kt Removes usage of the deleted hasOngoingCall model field in test fixtures.
app/src/test/kotlin/com/wire/android/ui/home/conversations/composer/MessageComposerViewModelArrangement.kt Updates mocked conversation details to no longer require hasOngoingCall.
app/src/test/kotlin/com/wire/android/ui/home/conversations/call/ConversationCallViewModelTest.kt Switches call-state observation in tests from ongoing calls list to joinable calls map.
app/src/main/kotlin/com/wire/android/ui/home/HomeViewModelFactory.kt Wires ObserveJoinableCallsUseCase into conversation list/search-related construction.
app/src/main/kotlin/com/wire/android/ui/home/conversationslist/ConversationListViewModel.kt Combines conversation list details with joinable calls to build UI items with join-call markers.
app/src/main/kotlin/com/wire/android/ui/home/conversations/usecase/GetConversationsFromSearchUseCase.kt Combines paginated search results with joinable calls to map items with call markers.
app/src/main/kotlin/com/wire/android/ui/home/conversations/call/ConversationCallViewModel.kt Uses joinable calls map to derive hasOngoingCall state for the conversation call screen.
app/src/main/kotlin/com/wire/android/ui/calling/CallingViewModelFactory.kt Updates factory wiring to provide ObserveJoinableCallsUseCase to ConversationCallViewModel.
app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt Adds joinable-calls map input and derives call marker/new-activity signals from it.
app/src/main/kotlin/com/wire/android/di/accountScoped/CallsModule.kt Exposes ObserveJoinableCallsUseCase from CallsScope for injection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MohamadJaara MohamadJaara force-pushed the mo/refactor/get-calls-status-from-in-memory branch from 3e87592 to 1e6574c Compare July 8, 2026 11:13
Comment on lines +155 to +156
): Flow<PagingData<ConversationItem>> = channelFlow {
val latestJoinableCallsByConversationId = MutableStateFlow(initialJoinableCallsByConversationId)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need channelFlow and MutableStateFlow here? It looks like only one coroutine calls send(), and the MutableStateFlow seems to be used just to keep the latest value rather than as a reactive stream.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch We still need to collect joinableCallsFlow concurrently because PagingData.map is lazy and newly loaded pages should use the latest call state without call changes reemitting the same PagingData. However, you’re right that only one coroutine emits and the MutableStateFlow is only being used as a latest-value holder. I’ll simplify this to a regular flow with a child collector and use an AtomicReference for the thread-safe snapshot.

@MohamadJaara MohamadJaara requested a review from ohassine July 13, 2026 11:07
@sonarqubecloud

Copy link
Copy Markdown

@MohamadJaara MohamadJaara enabled auto-merge July 13, 2026 13:39
@MohamadJaara MohamadJaara added this pull request to the merge queue Jul 13, 2026
Merged via the queue into develop with commit ff8fa7a Jul 13, 2026
18 checks passed
@MohamadJaara MohamadJaara deleted the mo/refactor/get-calls-status-from-in-memory branch July 13, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants